package com.xxzb.pack0823.线程同步.互斥同步;

public class TicketTest {
    public static void main(String[] args) {
        final Ticket ticket = new Ticket();
        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    ticket.saleTicket();
                }
            }
        }, "售票点1").start();

        new Thread(new Runnable() {
            @Override
            public void run() {
                for (int i = 0; i < 10; i++) {
                    ticket.saleTicket();
                }
            }
        }, "售票点2").start();
    }
}
